Part Number Hot Search : 
15N05 VLDS1235 11CUR SL322 5KE18 2301P 01012 ASI10728
Product Description
Full Text Search
 

To Download AT89S2051 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  features ? compatible with mcs ? 51 products  2k/4k bytes of in-system programmable (isp) flash program memory ? serial interface for program downloading ? endurance: 10,000 write/erase cycles  2.7v to 5.5v operating range  fully static operation: 0 hz to 24 mhz  two-level program memory lock  256 x 8-bit internal ram  15 programmable i/o lines  two 16-bit timer/counters  six interrupt sources  programmable serial uart channel  direct led drive outputs  on-chip analog comparator with selectable interrupt  8-bit pwm (pulse-width modulation)  low power idle and power-down modes  brownout reset  enhanced uart serial port with framing error detection and automatic address recognition  internal power-on reset  interrupt recovery from power-down mode  programmable and fuseable x2 clock option  four-level enhanced interrupt controller  power-off flag  flexible programming (byte and page modes) ? page mode: 32 bytes/page  user serviceable signature page (32 bytes) 1. description the AT89S2051/s4051 is a low-voltage, high-performance cmos 8-bit microcontrol- ler with 2k/4k bytes of in-system programmable (isp) flash program memory. the device is manufactured using atmel?s high-density nonvolatile memory technology and is compatible with the industry-standard mcs-51 instruction set. by combining a versatile 8-bit cpu with flash on a monolithic chip, the atmel AT89S2051/s4051 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. moreover, the AT89S2051/s4051 is designed to be function compatible with the at89c2051/c4051 devices, respectively. the AT89S2051/s4051 provides the following standard features: 2k/4k bytes of flash, 256 bytes of ram, 15 i/o lines, two 16-bit timer/counters, a six-vector, four- level interrupt architecture, a full duplex enhanced serial port, a precision analog comparator, on-chip and clock circuitry. hardware support for pwm with 8-bit resolu- tion and 8-bit prescaler is available by reconfiguring the two on-chip timer/counters. in addition, the AT89S2051/s4051 is designed with static logic for operation down to zero frequency and supports two software-selectable power saving modes. the idle mode stops the cpu while allowing the ram, timer/counters, serial port and interrupt system to continue functioning. the po wer-down mode saves the ram contents but freezes the disabling all other chip functions until the next external interrupt or hardware reset. 8-bit microcontroller with 2k/4k bytes flash AT89S2051 at89s4051 preliminary 3390c?micro?7/05
2 3390c?micro?7/05 AT89S2051/s4051 the on-board flash program memory is accessible through the isp serial interface. holding rst active forces the device into a serial programming interface and allows the program mem- ory to be written to or read from, unless one or more lock bits have been activated. 2. pin configuration 2.1 20-lead pdip/soic 3. block diagram 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 rst/vpp (rxd) p3.0 (txd) p3.1 xtal2 xtal1 (int0) p3.2 (int1) p3.3 (t0) p3.4 (t1) p3.5 gnd vcc p1.7 (sck) p1.6 (miso) p1.5 (mosi) p1.4 p1.3 p1.2 p1.1 (ain1) p1.0 (ain0) p3.7
3 3390c?micro?7/05 AT89S2051/s4051 4. pin description 4.1 vcc supply voltage. 4.2 gnd ground. 4.3 port 1 port 1 is an 8-bit bi-directional i/o port. port pins p1.2 to p1.7 provide internal pull-ups. p1.0 and p1.1 require external pull-ups. p1.0 and p1.1 also serve as the positive input (ain0) and the negative input (ain1), respectively, of the on-chip precision analog comparator. the port 1 out- put buffers can sink 20 ma and can drive led displays directly. when 1s are written to port 1 pins, they can be used as inputs. when pins p1.2 to p1.7 are used as inputs and are externally pulled low, they will source current (i il ) because of the internal pull-ups. port 1 also receives code data during flash programming and verification. 4.4 port 3 port 3 pins p3.0 to p3.5, p3.7 are seven bi -directional i/o pins with internal pull-ups. p3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a general-purpose i/o pin. the port 3 output buffers can sink 20 ma. when 1s are written to port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. as inputs, port 3 pins that are externally being pulled low will source current (i il ) because of the pull-ups. port 3 also serves the functions of various special features of the AT89S2051/s4051 as listed below: port 3 also receives some control signals for flash programming and verification. port pin alternate functions p1.5 mosi (master data output, slave data input pin for isp channel) p1.6 miso (master data input, slave data output pin for isp channel) p1.7 sck (master clock output, slave clock input pin for isp channel) port pin alternate functions p3.0 rxd (serial input port) p3.1 txd (serial output port) p3.2 int0 (external interrupt 0) p3.3 int1 (external interrupt 1) p3.4 t0 (timer 0 external input) p3.5 t1 (timer 1 external input)/ pwm output
4 3390c?micro?7/05 AT89S2051/s4051 4.5 rst reset input. holding the rst pin high for two machine cycles while the is running resets the device. each machine cycle takes 6 or clock cycles. 4.6 xtal1 input to the inverting amplifier and input to the internal clock operating circuit. 4.7 xtal2 output from the inverting amplifier. 5. characteristics xtal1 and xtal2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip , as shown in figure 5-1 . either a quartz crystal or ceramic res- onator may be used. to drive the device from an external clock source, xtal2 should be left unconnected while xtal1 is driven as shown in figure 5-2 . there are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. figure 5-1. connections note: c1, c2 = 30 pf 10 pf for crystals = 40 pf 10 pf for ceramic resonators figure 5-2. external clock drive configuration
5 3390c?micro?7/05 AT89S2051/s4051 6. x2 mode description the clock for the entire circuit and peripherals is normally divided by 2 before being used by the cpu core and peripherals. this allows any cyclic ratio (duty cycle) to be accepted on xtal1 input. in x2 mode this divider is bypassed. figure 6-1 shows the clock generation block diagram. figure 6-1. clock generation block diagram 7. special function registers a map of the on-chip memory area called the special function register (sfr) space is shown in table 7-1 . note that not all of the addresses are occupied, and unoccupied addresses may not be imple- mented on the chip. read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. user software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. in that case, the reset or inactive values of the new bits will always be 0. 2 (xtal1)/2 x2 mode f osc state machine: 6 clock cycles cpu control f xtal xtal1
6 3390c?micro?7/05 AT89S2051/s4051 table 7-1. AT89S2051/s4051 sfr map and reset values 0f8h 0ffh 0f0h b 00000000 0f7h 0e8h 0efh 0e0h acc 00000000 0e7h 0d8h 0dfh 0d0h psw 00000000 0d7h 0c8h 0cfh 0c0h 0c7h 0b8h ip x0x00000 saden 00000000 0bfh 0b0h p3 11111111 iph x0x00000 0b7h 0a8h ie 00x00000 saddr 00000000 0afh 0a0h 0a7h 98h scon 00000000 sbuf xxxxxxxx 9fh 90h p1 11111111 acsr xxx00000 97h 88h tcon 00000000 tmod 00000000 tl0 00000000 tl1 00000000 th0 00000000 th1 00000000 clkreg xxxxxx0x 8fh 80h sp 00000111 dpl 00000000 dph 00000000 pcon 000x0000 87h
7 3390c?micro?7/05 AT89S2051/s4051 8. restrictions on certain instructions the AT89S2051/s4051 is an economical and cost-effective member of atmel?s family of micro- controllers. it contains 2k/4k bytes of flash pr ogram memory. it is fully compatible with the mcs-51 architecture, and can be programmed using the mcs-51 instruction set. however, there are a few considerations one must keep in mind when utilizing certain instructions to pro- gram this device. all the instructions related to jumping or branching should be restricted such that the destination address falls within the physical program memory space of the device, which is 2k/4k for the AT89S2051/s4051. this should be the responsibility of the software programmer. for example, ljmp 7e0h would be a valid instruction for the AT89S2051 (with 2k of memory), whereas ljmp 900h would not. 8.1 branching instructions lcall, ljmp, acall, ajmp, sjmp, jmp @a+dptr. these unconditional branching instructions will execute correctly as long as the programmer keeps in mind that the destination branching address must fall within the physical boundaries of the program memory size (loca- tions 00h to 7ffh/fffh for the AT89S2051/s4051). violating the physical space limits may cause unknown program behavior. cjne [...], djnz [...], jb, jnb, jc, jnc, jbc, jz, jnz. with these conditional branching instructions, the same rule above applies. again, violating the memory boundaries may cause erratic execution. for applications involving interrupts, the normal interrupt service routine address locations of the 80c51 family architecture have been preserved. 8.2 movx-related instructions, data memory the AT89S2051/s4051 contains 256 bytes of internal data memory. external data memory access is not supported in this device, nor is external program memory execution. therefore, no movx [...] instructions should be included in the program. a typical 80c51 assembler will still assemble instructions, even if they are written in violation of the restrictions mentioned above. it is the responsibility of the user to know the physical features and limitations of the device being used and adjust the instructions used accordingly. 9. program memory lock bits on the chip are two lock bits which can be left unprogrammed (u) or can be programmed (p) to obtain the additional features listed in table 9-1 : note: 1. the lock bits can only be erased with the chip erase operation. table 9-1. lock bit protection modes (1) program lock bits lb1 lb2 protection type 1 u u no program lock features. 2 p u further programming of the flash is disabled. 3 p p same as mode 2, also verify is disabled.
8 3390c?micro?7/05 AT89S2051/s4051 10. reset during reset, all i/o registers are set to their initial values, the port pins are weakly pulled to v cc , and the program starts execution from the reset vector, 0000h. the AT89S2051/s4051 has three sources of reset: power-on reset, brown-out reset, and external reset. 10.1 power-on reset a power-on reset (por) is generated by an on-chip detection circuit. the detection level is nominally 1.4v. the por is activated whenever v cc is below the detection level. the por cir- cuit can be used to trigger the start-up reset or to detect a supply voltage failure in devices without a brown-out detector. the por circuit en sures that the device is reset from power-on. when v cc reaches the power-on reset threshold voltage, the pierce oscillator is enabled (if the xtal oscillator bypass fuse is off). only after v cc has also reached the bod (brown-out detection) level (see section 10.2 ?brown-out reset? ), the bod delay counter starts measuring a 2-ms delay after which the internal reset is deasserted and the microcontroller starts executing. the built-in 2-ms delay allows the v cc voltage to reach the minimum 2.7v level before execut- ing, thus guaranteeing the maximum operating clock frequency. the por signal is activated again, without any delay, when v cc falls below the por threshold level. a power-on reset (i.e. a cold reset) will set the pof flag in pcon. refer to figure 10-1 for details on the por/bod behavior. figure 10-1. power-up and brown-out detection sequence por por level 1.4v bod level 2. 3 v min v cc level 2.7v xtal1 bod intern a l re s et t t t t t v cc t por (2 m s ) t por (2 m s ) t por (2 m s ) 2.4v 1.2v 0
9 3390c?micro?7/05 AT89S2051/s4051 10.2 brown-out reset the AT89S2051/s4051 has an on-chip brown-out detection (bod) circuit for monitoring the v cc level during operation by comparing it to a fixed trigger level. the trigger level for the bod is nominally 2.2v. the purpose of the bod is to ensure that if v cc fails or dips while executing at speed, the system will gracefully enter reset without the possibility of errors induced by incorrect execution. when v cc decreases to a value below the trigger level, the brown-out reset is imme- diately activated. when v cc increases above the trigger level, the bod delay counter starts the microcontroller after the timeout period has expired in approximately 2 ms. 10.3 external reset the rst pin functions as an active-high reset input. the pin must be held high for at least two machine cycles to trigger the internal reset. rst also serves as the in-system programming (isp) enable input. isp mode is enabled when t he external reset pin is held high and the isp enable fuse is set. 11. clock register . table 11-1. clkreg ? clock register clkreg = 8fh reset value = xxxx xx0xb not bit addressable ??????pwdexx2 bit76543210 symbol function pwdex power-down exit mode. when pwdex = 1, wake up from power-down is externally controlled. when pwdex = 0, wake up from power-down is internally timed. x2 when x2 = 0, the frequency (at xtal1 pin) is internally divided by 2 before it is used as the device system frequency. when x2 = 1, the divide by 2 is no longer used and the xtal1 frequency becomes the device system frequency. this enables the user to use a 6 mhz crystal instead of a 12 mhz crystal in order to reduce emi. the x2 bit is initialized on power-up with the value of the x2 user fuse and may be changed at runtime by software.
10 3390c?micro?7/05 AT89S2051/s4051 12. power saving modes the AT89S2051/s4051 supports two power-reducing modes: idle and power-down. these modes are accessed through the pcon register. 12.1 idle mode setting the idl bit in pcon enters idle mode. idle mode halts the internal cpu clock. the cpu state is preserved in its entirety, including the ram, stack pointer, program counter, program status word, and accumulator. the port pins hold the logical states they had at the time that idle was activated. idle mode leaves the peripherals running in order to allow them to wake up the cpu when an interrupt is generated. timer 0, timer 1, and the uart will continue to function during idle mode. the analog comparator is disabled during idle. any enabled interrupt source or reset may terminate idle mode. when exiting idle mode with an interrupt, the interrupt will immediately be serviced, and following reti, the next instruction to be executed will be the one following the instruction that put the device into idle. p1.0 and p1.1 should be set to ?0? if no external pull-ups are used, or set to ?1? if external pull- ups are used. 12.2 power-down mode setting the pd bit in pcon enters power-down mode. power-down mode stops the and powers down the flash memory in order to minimize power consumption. only the power-on circuitry will continue to draw power during power-dow n. during power-down the power supply voltage may be reduced to the ram keep-alive voltage. the ram contents will be retained; however, the sfr contents are not guaranteed once v cc has been reduced. power-down may be exited by external reset, power-on reset, or certain interrupts. the user should not attempt to enter (or re-enter) the power-down mode for a minimum of 4 s until after one of the following conditions has occurred: start of code execution (after any type of reset), or exit from power-down mode. 12.3 interrupt recovery from power-down two external interrupts may be configured to terminate power-down mode. external interrupts int0 (p3.2) and int1 (p3.3) may be used to exit power-down. to wake up by external interrupt int0 or int1 , the interrupt must be enabled and configured for level-sensitive operation. when terminating power-down by an interrupt, two different wake up modes are available. when pwdex in clkreg.2 is zero, the wake up period is internally timed. at the falling edge on the interrupt pin, power-down is exited, the is restarted, and an internal timer begins count- ing. the internal clock will not be allowed to propagate and the cpu will not resume execution until after the timer has counted for nominally 2 ms. after the timeout period the interrupt service routine will begin. to prevent the interrupt from re-triggering, the isr should disable the interrupt before returning. the interrupt pin should be held low until the device has timed out and begun executing. when pwdex = 1 the wakeup period is controlled externally by the interrupt. again, at the fall- ing edge on the interrupt pin, power-down is exited and the is restarted. however, the internal clock will not propagate and cpu will not resume execution until the rising edge of the interrupt pin. after the rising edge on the pin, the interrupt service routine will begin. the interrupt should be held low long enough for the to stabilize.
11 3390c?micro?7/05 AT89S2051/s4051 12.4 reset recovery from power-down wakeup from power-down through an external reset is similar to the interrupt with pwdex = 0. at the rising edge of rst, power-down is exited, the is restarted, and an internal timer begins counting. the internal clock will not be allowed to propagate to the cpu until after the timer has counted for nominally 2 ms. the rst pin must be held high for longer than the timeout period to ensure that the device is reset properly. the device will begin executing once rst is brought low. it should be noted that when idle is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. on-chip hardware inhibits access to internal ram in this event, but access to the port pins is not inhibited. to e liminate the possibility of an unexpected write to a port pin when idle is terminated by reset, the instruction following the one that invokes idle should not be one that writes to a port pin or to external memory. p1.0 and p1.1 should be set to ?0? if no external pull-ups are used, or set to ?1? if external pull- ups are used. . table 12-1. pcon ? power control register pcon = 87h reset value = 000x 0000b not bit addressable smod1 smod0 pwmen pof gf1 gf0 pd idl bit76543210 symbol function smod1 double baud rate bit. doubles the baud rate of the uart in modes 1, 2, or 3. smod0 frame error select. when smod0 = 0, scon.7 is sm0. when smod0 = 1, scon.7 is fe. note that fe will be set after a frame error regardless of the state of smod0. pwmen pulse width modulation enable. when pwmen = 1, timer 0 and timer 1 are configured as an 8-bit pwm counter with 8-bit auto-reload prescaler. the pwm outputs on t1 (p3.5). pof power off flag. pof is set to ?1? during power up (i.e. cold reset). it can be set or reset under software control and is not affected by rst or bod (i.e. warm resets). gf1, gf0 general-purpose flags pd power down bit. setting this bit activates power down operation. idl idle mode bit. setting this bit activates idle mode operation
12 3390c?micro?7/05 AT89S2051/s4051 13. interrupts the AT89S2051/s4051 provides 6 interrupt sources: two external interrupts, two timer inter- rupts, a serial port interrupt, and an analog comparator interrupt. these interrupts and the system reset each have a separate program vector at the start of the program memory space. each interrupt source can be individually enabled or disabled by setting or clearing a bit in the interrupt enable register ie. the ie register also contains a global disable bit, ea, which disables all interrupts. each interrupt source can be individually programmed to one of four priority levels by setting or clearing bits in the interrupt priority registers ip and iph. an interrupt service routine in progress can be interrupted by a higher priority interrupt, but not by another interrupt of the same or lower priority. the highest priority interrupt cannot be interrupted by any other interrupt source. if two requests of different priority levels are pending at the end of an instruction, the request of higher priority level is serviced. if requests of the same priority level are pending at the end of an instruction, an internal polling sequence determines which request is serviced. the polling sequence is based on the vector address; an interr upt with a lower vector address has higher priority than an interrupt with a higher vector address. note that the polling sequence is only used to resolve pending requests of the same priority level. the external interrupts int0 and int1 can each be either level-activated or transition-activated, depending on bits it0 and it1 in register tcon. the flags that actually generate these inter- rupts are the ie0 and ie1 bits in tcon. when the service routine is vectored to, hardware clears the flag that generated an external interrupt only if the interrupt was transition-activated. if the interrupt was level activated, then the external requesting source (rather than the on-chip hard- ware) controls the request flag. the timer 0 and timer 1 interrupts are generated by tf0 and tf1, which are set by a rollover in their respective timer/counter registers (except for timer 0 in mode 3). when a timer interrupt is generated, the on-chip hardware clears the flag that generated it when the service routine is vectored to. the serial port interrupt is generated by the logical or of ri and ti in scon. neither of these flags is cleared by hardware when the service routine is vectored to. in fact, the service routine normally must determine whether ri or ti generated the interrupt, and the bit must be cleared in software. the cf bit in acsr generates the comparator interrupt. the flag is not cleared by hardware when the service routine is vectored to and must be cleared by software. most of the bits that generate interrupts can be set or cleared by software, with the same result as though they had been set or cleared by har dware. that is, interrupts can be generated and pending interrupts can be canceled in software. interrupt source vector address system reset rst or por or bod 0000h external interrupt 0 ie0 0003h timer 0 overflow tf0 000bh external interrupt 1 ie1 0013h timer 1 overflow tf1 001bh serial port ri or ti 0023h analog comparator cf 0033h
13 3390c?micro?7/05 AT89S2051/s4051 14. interrupt registers . . table 14-1. ie ? interrupt enable register ie = a8h reset value = 00x0 0000b bit addressable ea ec ? es et1 ex1 et0 ex0 bit76543210 symbol function ea global enable/disable. all interrupts are disabled when ea = 0. when ea = 1, each interrupt source is enabled/disabled by setting/clearing its own enable bit. ec comparator interrupt enable es serial port interrupt enable et1 timer 1 interrupt enable ex1 external interrupt 1 enable et0 timer 0 interrupt enable ex0 external interrupt 0 enable table 14-2. ip ? interrupt priority register ip = b8h reset value = x0x0 0000b bit addressable ? pc ? ps pt1 px1 pt0 px0 bit76543210 symbol function pc comparator interrupt priority low ps serial port interrupt priority low pt1 timer 1 interrupt priority low px1 external interrupt 1 priority low pt0 timer 0 interrupt priority low px0 external interrupt 0 priority low table 14-3. iph ? interrupt priority high register iph = b7h reset value = x0x0 0000b not bit addressable ? pch ? psh pt1h px1h pt0h px0h bit76543210 symbol function pch comparator interrupt priority high psh serial port interrupt priority high pt1h timer 1 interrupt priority high px1h external interrupt 1 priority high pt0h timer 0 interrupt priority high px0h external interrupt 0 priority high
14 3390c?micro?7/05 AT89S2051/s4051 15. timer/counters the AT89S2051/s4051 have two 16-bit timer/counters: timer 0 and timer 1. the timer/counters are identical to those in the at89c2051/c4051. for more detailed information on the timer/counter operation, please click on the document link below: http://www.atmel.com/dyn/resources/prod_documents/doc4316.pdf 16. pulse width modulation timer 0 and timer 1 may be configured as an 8-bit pulse width modulator by setting the pwmen bit in pcon. the generated waveform is output on the timer 1 input pin, t1. in pwm mode timer 0 acts as an 8-bit prescaler to select the pwm timebase. timer 0 is forced into mode 2 (8- bit auto-reload) by pwmen and the value in th0 will determine the clock division from 0 (ffh) to 256 (00h). timer 1 acts as the 8-bit pwm coun ter. tl1 counts once on every overflow from tl0. th1 stores the 8-bit pulse width value. on the ffh-->00h overflow of tl1, the pwm output is set high. when the count in tl1 matches the value in th1, the pwm output is set low. there- fore, the output pulse width is proportional to the value in th1. to prevent glitches, writes to th1 only take effect on the ffh-->00h overflow of tl1. however, a read from th1 will read the new value at any time after a write to th1. see figure 16-1 for pwm waveform example. figure 16-1. pulse width modulation (pwm) output waveform figure 16-2. timer 0/1 pulse width modulation mode tl0 counts once every machine cycle (1 machine cycle = 12 clocks in x1 mode) and th0 is the reload value for when tl0 overflows. every time tl0 overflows tl1 increments by one, with tl0 overflowing after counting 256 minus th0 machine cycles. to calculate the pulse width for the pwm output on pin t1, users should use the following formula: th1 * (256 - th0) * (1/clock_freq) * 12 = pulse width pwm output (t1) counter value (tl1) compare value (th1) o s c 12 t l0 t h 0 t h 1 t l1 ocr p 3 . 5 p w m = ?
15 3390c?micro?7/05 AT89S2051/s4051 tl1 will always count from 00h to ffh. the output on the timer 1 (t1) pin will be high from when tl1 equals 00h until tl1 equals th1 (see figure 16-3 ). th1 does not act as the reload value for tl1 on overflow. instead, th1 is used strictly as a compare value (see figure 16-2 ). figure 16-3. example of a pwm output 17. uart the uart in the AT89S2051/s4051 operates the same way as the uart in the at89c2051/c4051. for more detailed information on the uart operation, please click on the document link below: http://www.atmel.com/dyn/resources/prod_documents/doc4316.pdf 17.1 enhanced uart in addition to all of its usual modes, the uart can perform framing error detection by looking for missing stop bits, and automatic address recognition. the uart also fully supports multiproces- sor communication as does the standard 80c51 uart. when used for framing error detect, the uart looks for missing stop bits in the communication. a missing bit will set the fe bit in the scon register. the fe bit shares the scon.7 bit with sm0 and the function of scon.7 is determined by pcon.6 (smod0). if smod0 is set then scon.7 functions as fe. scon.7 functions as sm0 when smod0 is cleared. when used as fe, scon.7 can only be cleared by software. 17.2 automatic address recognition automatic address recognition is a feature which allows the uart to recognize certain addresses in the serial bit stream by using ha rdware to make the comparisons. this feature saves a great deal of software overhead by eliminating the need for the software to examine every serial address which passes by the serial port. this feature is enabled by setting the sm2 bit in scon. in the 9-bit uart modes, mode 2 and mode 3, the receive interrupt flag (ri) will be automatically set when the received byte contains either the ?given? address or the ?broad- cast? address. the 9-bit mode requires that the 9th information bit is a 1 to indicate that the received information is an address and not data. the 8-bit mode is called mode 1. in this mode the ri flag will be set if sm2 is enabled and the information received has a valid stop bit following the 8 address bits and the information is either a given or broadcast address. mode 0 is the shift register mode and sm2 is ignored. using the automatic address rec ognition feature allows a master to selectively communicate with one or more slaves by invoking the given slave address or addresses. all of the slaves may be contacted by using the broadcast address. two special function registers are used to define the slave?s address, saddr, and the address mask, saden. saden is used to define which bits in the saddr are to be used and which bits are ?don?t care?. the saden mask can 00 01 10 . . . th1 . . . ff 00 . . . t l1 count t1
16 3390c?micro?7/05 AT89S2051/s4051 be logically anded with the saddr to create the ?given? address which the master will use for addressing each of the slaves. use of the given address allows multiple slaves to be recognized while excluding others. the following examples will help to show the versatility of this scheme: slave 0 saddr = 1100 0000 saden = 1111 1101 given = 1100 00x0 slave 1 saddr = 1100 0000 saden = 1111 1110 given = 1100 000x in the previous example saddr is the same and the saden data is used to differentiate between the two slaves. slave 0 requires a 0 in bit 0 and it ignores bit 1. slave 1 requires a 0 in bit 1 and bit 0 is ignored. a unique address for slave 0 would be 1100 0010 since slave 1 requires a 0 in bit 1. a unique address for sl ave 1 would be 1100 0001 since a 1 in bit 0 will exclude slave 0. both slaves can be selected at the same time by an address which has bit 0 = 0 (for slave 0) and bit 1 = 0 (for slave 1). thus, both could be addressed with 1100 0000. in a more complex system the following could be used to select slaves 1 and 2 while excluding slave 0: slave 0 saddr = 1100 0000 saden = 1111 1001 given = 1100 0xx0 slave 1 saddr = 1110 0000 saden = 1111 1010 given = 1110 0x0x slave 2 saddr = 1110 0000 saden = 1111 1100 given = 1110 00xx in the above example the differentiation among the 3 slaves is in the lower 3 address bits. slave 0 requires that bit 0 = 0 and it can be uniquely addressed by 1110 0110. slave 1 requires that bit 1 = 0 and it can be uniquely addressed by 1110 and 0101. slave 2 requires that bit 2 = 0 and its unique address is 1110 0011. to select slaves 0 and 1 and exclude slave 2, use address 1110 0100, since it is necessary to make bit 2 = 1 to exclude slave 2. the broadcast address for each slave is created by taking the logical or of saddr and saden. zeros in this result are trended as don?t cares. in most cases, interpreting the don?t cares as ones, the broadcast address will be ff hexadecimal. upon reset saddr (sfr address 0a9h) and saden (sfr address 0b9h) are loaded with 0s. this produces a given address of all ?don?t cares? as well as a broadcast address of all ?don?t cares?. this effectively disables the automatic addressing mode and allows the microcontroller to use standard 80c51-type uart drivers which do not make use of this feature.
17 3390c?micro?7/05 AT89S2051/s4051 notes: 1. smod is located at pcon.7. 2. f osc = frequency. table 17-1. scon ? serial port control register scon address = 98h reset value = 0000 0000b bit addressable sm0/fe sm1 sm2 ren tb8 rb8 ti ri bit7 6543210 (smod = 0/1) (1) symbol function fe framing error bit. this bit is set by the receiver when an invalid stop bit is detected. the fe bit is not cleared by valid frames but should be cleared by software. the smod0 bit must be set to enable access to the fe bit. fe will be set regardless of the state of smod. sm0 serial port mode bit 0, (smod must = 0 to access bit sm0) sm1 serial port mode bit 1 sm2 enables the automatic address recognition feature in modes 2 or 3. if sm2 = 1 then rl will not be set unless the received 9th data bit (rb8) is 1, indicating an address, and the received byte is a given or broadcast address. in mode 1, if sm2 = 1 then rl will not be activated unless a valid stop bit was received, and the received byte is a given or broadcast address. in mode 0, sm2 should be 0. ren enables serial reception. set by software to enable reception. clear by software to disable reception. tb8 the 9th data bit that will be transmitted in modes 2 and 3. set or clear by software as desired. rb8 in modes 2 and 3, the 9th data bit that was received. in mode 1, if sm2 = 0, rb8 is the stop bit that was received. in mode 0, rb8 is not used. ti transmit interrupt flag. set by hardware at the end of t he 8th bit time in mode 0, or at the beginning of the stop bit in the other modes, in any serial transmission. must be cleared by software. ri receive interrupt flag. set by hardware at the end of the 8th bit time in mode 0, or halfway through the stop bit time in the other modes, in any serial reception (except see sm2). must be cleared by software. sm0 sm1 mode description baud rate (2) 0 0 0 shift register f osc /12 0 1 1 8-bit uart variable 1029-bit uartf osc /64 or f osc /32 1 1 3 9-bit uart variable
18 3390c?micro?7/05 AT89S2051/s4051 18. analog comparator a single analog comparator is provided in the AT89S2051/s4051. the comparator operation is such that the output is a logical ?1? when the positive input ain0 (p1.0]) is greater than the neg- ative input ain1 (p1.1). otherwise the output is a zero. setting the cen bit in acsr enables the comparator. when the comparator is first enabled, the comparator output and interrupt flag are not guaranteed to be stable for 10 microseconds. the corresponding comparator interrupt should not be enabled during that time, and the comparator interrupt flag must be cleared before the interrupt is enabled in order to prevent an immediate interrupt service. the comparator may be configured to cause an interrupt under a variety of output value condi- tions by setting the cm bits in acsr. the comparator interrupt flag cf in acsr is set whenever the comparator output matches the condition specified by cm. the flag may be polled by soft- ware or may be used to generate an interrupt and must be cleared by software. the analog comparator is always disabled during idle or power-down modes. 19. comparator interrupt with debouncing the comparator output is sampled at every state 4 (s4) of every machine cycle. the conditions on the analog inputs may be such that the comparator output will toggle excessively. this is especially true if applying slow moving analog inputs. three debouncing modes are provided to filter out this noise. in debouncing mode, the comparator uses timer 1 to modulate its sampling time. when a relevant transition occurs, the comparator waits until two timer 1 overflows have occurred before resampling the output. if the new sample agrees with the expected value, cf is set. otherwise, the event is ignored. the filter may be tuned by adjusting the timeout period of timer 1. because timer 1 is free running, the debouncer must wait for two overflows to guaran- tee that the sampling delay is at least 1 timeout period. therefore after the initial edge event, the interrupt may occur between 1 and 2 timeout periods later. see figure 19-1 . figure 19-1. example of negative edge comparator interrupt with debouncing comparator out timer 1 overflow cf start compare start compare
19 3390c?micro?7/05 AT89S2051/s4051 20. analog comparator register . table 20-1. acsr ? analog comparator control & status register acsr = 97h reset value = xxx0 0000b not bit addressable ? ? ? cf cen cm2 cm1 cm0 bit76543210 symbol function cf comparator interrupt flag. set when the comparator output meets the conditions specified by the cm [2:0] bits and cen is set. the flag must be cleared by software. the interrupt may be enabled/disabled by setting/clearing bit 6 of ie. cen comparator enable. set this bit to enable the comparator. clearing this bit will force the comparator output low and prevent further events from setting cf. cm [2:0] comparator interrupt mode 210 interrupt mode --- ---- ---- --------------------------------------- 0 0 0 negative (low) level 001 positive edge 0 1 0 toggle with debounce 0 1 1 positive edge with debounce 100 negative edge 101 toggle 1 1 0 negative edge with debounce 1 1 1 positive (high) level
20 3390c?micro?7/05 AT89S2051/s4051 21. parallel programming specification atmel?s AT89S2051/s4051 offers 2k/4k bytes of in-system programmable flash code memory. in addition, the device contains a 32-byte us er signature row and a 32-byte read-only atmel signature row. figure 21-1. flash parallel programming device connections note: 1. sampling of pin p3.1 (rdy/bsy ) is optional. in parallel mode, p3.1 will be pulled low while the device is busy. however, it requires an external passive pull-up to v cc . also, note that p3.6 does not exist, so testcode connects to p3.7, p3.5, p3.4, and p3.3. table 21-1. memory organization device # page size # pages address range page range AT89S2051 32 bytes 64 0000h - 07ffh 00h - 3fh at89s4051 32 bytes 128 0000h - 0fffh 00h - 7fh p3.7-3 rdy/bsy prog testcode inc 2.7v to 5.5v p3.1 v pp rst p1.7 - p1.0 xtal1 gnd v cc AT89S2051/s4051 p3.2 data in/out (1)
21 3390c?micro?7/05 AT89S2051/s4051 notes: 1. the internal y-address counter is reset to 00h on the rising/falling edge of rst. 2. a positive pulse on xtal1 loads the address data on port p1 into the x-address (page) register and resets the y-address. 3. a positive pulse on xtal1 advances the y-address counter. 4. a low pulse on p3.2 loads data from port p1 for the current address. if another p3.2 low pulse does not arrive within 150 s, programming starts. 5. internally timed for 4 ms. 6. internally timed for 2 ms. 7. 00h must be loaded into the x-address before executing this command. 8. will read user signature if x-address is 00h, will read atmel signature if x-address is 01h. 9. fuse/lock bit definitions: 10. atmel signature bytes : table 21-2. parallel programming mode command summary mode test control test selects data i/o p3.2 rst (1) inc p3.3 p3.4 p3.5 p3.7 p1.7-0 chip erase (5) 1.0 s 12v l h l l l xx load x-address (2) h 12v 0.1 s h l h h d in page write (3)(4)(6) code memory 1.0 s 12v 0.1 s l h h h d in page read (3) code memory h 12v 0.1 s l l h h d out page write (3)(4)(6)(7) sig. row 1.0 s12v0.1 slllld in page read (3)(8)(10) sig. row h 12v 0.1 s l l l h d out write fuse/lock bit (5)(9) 1.0 s12v l hhhhd in read fuse/lock bit (9) h12vl hhlld out bit 7 bit 6 bit 5 bit 4 bit 1 bit 0 xtal osc bypass user row programming x2 clock serial programming lock bit 2 lock bit 1 enable = 0/disable = 1 enable = 0/disable = 1 enable = 0/disable = 1 enable = 0/disable = 1 locked = 0/unlocked = 1 locked = 0/unlocked = 1 AT89S2051: address 00h = 1eh 01h = 23h 02h = ffh at89s4051: address 00h = 1eh 01h = 43h 02h = ffh
22 3390c?micro?7/05 AT89S2051/s4051 22. power-up sequence execute the following sequence to power-up the device before programming. 1. apply power between vcc and gnd pins. 2. after v cc has settled, wait 10 s and bring rst to ?h?. 3. wait 4 ms for the internal power-on reset to timeout. 4. bring p3.2 to ?h? and drive p3.7, p3.5, p3.4, and p3.3 to known values, then wait 10 s. 5. raise rst/v pp to 12v to enable the parallel programming modes. 6. after v pp has settled, wait an additional 10 s before programming. figure 22-1. power-up operation 23. power-down sequence execute the following sequence to power-down the device after programming. 1. tri-state port p1. 2. bring rst/v pp down from 12v to v cc and wait 10 s. 3. bring xtal and p3.2 to ?l? and tri-state p3.7, p3.5, p3.4, and p3.3. 4. bring rst to ?l? and wait 10 s. 5. power off v cc . figure 23-1. power-down operation v cc r s t/v pp p 3 .2 p 3 . 3 - p 3 .7 xtal1 rdy/b s y p1.0 - p1.7 high z high z high z v cc r s t/v pp p 3 .2 p 3 . 3 - p 3 .7 xtal1 rdy/b s y p1.0 - p1.7 high z high z high z
23 3390c?micro?7/05 AT89S2051/s4051 24. chip erase function: 1. ffh programmed to every address location. 2. ffh programmed to user signature row if user row fuse bit is enabled. 3. lockbit1 and lockbit2 programmed to ?unlock? state. usage: 1. apply ?0001? testcode to p3.7, p3.5, p3.4, p3.3. 2. pulse p3.2 low for 1 s. 3. wait 4 ms, monitor p3.1, or poll data. note: this and the following waveforms are not to scale. figure 24-1. chip erase sequence 25. load x-address function: 1. loads the x-address register with data on port p1. the loaded address will select the page for subsequent write/read commands. the x-address is equivalent to bits [11:5] of the full byte address. 2. resets the y-address counter to 00h. the y-address is equivalent to bits [4:0] of the full byte address and selects a byte within a page. usage : 1. apply ?1101? testcode to p3.7, p3.5, p3.4, p3.3. 2. drive port p1 with 8-bit x-address data. 3. pulse xtal1 high for at least 100 ns. the address is latched on the falling edge of xtal1. figure 25-1. load x-address sequence p 3 .2 p 3 . 3 - p 3 .7 xtal1 rdy/b s y p1.0 - p1.7 0001 high z p 3 .2 p 3 . 3 - p 3 .7 xtal1 rdy/b s y p1.0 - p1.7 1101 xaddr high z high z
24 3390c?micro?7/05 AT89S2051/s4051 26. page write 4k code function: 1. programs 1 page (1 to 32 bytes) of data into the code memory array. 2. x-address (page) determined by previous load-x command. 3. y-address (offset) incremented by positive pulse on xtal1. 4. 1 byte of data is loaded from port p1 for the current x- and y-address by a low pulse on p3.2. usage: 1. execute the load-x command to set the page address and reset the offset. 2. apply ?1110? testcode to p3.7, p3.5, p3.4, p3.3. 3. drive port p1 with 8-bit data. 4. pulse p3.2 low for 1 s to load the data from port p1. 5. for additional bytes (up to 32), pulse xtal1 high for at least 100 ns to increment the y-address and repeat steps 3 and 4 within 150 s. 6. wait 2 ms, monitor p3.1, or poll data. note: it is possible to skip bytes by pulsing xtal1 high multiple times before pulsing p3.2 low. figure 26-1. page write 4k code programming sequence xaddr din0 din1 din n-1 1101 1110 p3.2 xtal1 p3.3 - p3.7 p1.0 - p1.7 rdy/b s y high z
25 3390c?micro?7/05 AT89S2051/s4051 27. read 4k code function: 1. read 1 page (1 to 32 bytes) of data from the code memory array. 2. x-address (page) determined by previous load-x command. 3. y-address (offset) incremented by positive pulse on xtal1. usage : 1. execute the load-x command to set the page address and reset the offset. 2. apply ?1100? testcode to p3.7, p3.5, p3.4, p3.3. 3. read 8-bit data on port p1. 4. for additional bytes (up to 32), pulse xtal1 high for at least 100 ns to increment the y-address and repeat step 3. the address will change on the falling edge of xtal1. figure 27-1. read 4k code programming sequence xaddr dout0 dout1 dout n-1 1101 1100 p3.2 xtal1 p3.3 - p3.7 p1.0 - p1.7 rdy/b s y
26 3390c?micro?7/05 AT89S2051/s4051 28. page write user signature row function: 1. programs 1 to 32 bytes of data into the user signature row. 2. x-address (page) should be 00h from a previous load-x command. 3. y-address (offset) incremented by positive pulse on xtal1. 4. 1 byte of data is loaded from port p1 for the current y-address by a low pulse on p3.2. 5. disabled if user row fuse bit is disabled. usage: 1. execute the load-x command to set the page to 00h and reset the offset. 2. apply ?0000? testcode to p3.7, p3.5, p3.4, p3.3. 3. drive port p1 with 8-bit data. 4. pulse p3.2 low for 1 s to load the data from port p1. 5. for additional bytes (up to 32), pulse xtal1 high for at least 100 ns to increment the y- address and repeat steps 3 and 4 within 150 s. 6. wait 2 ms, monitor p3.1, or poll data. note: it is possible to skip bytes by pulsing xtal1 high multiple times before pulsing p3.2 low. figure 28-1. page write user signature row sequence 00h din0 din1 din n-1 1101 0000 p3.2 xtal1 p3.3 - p3.7 p1.0 - p1.7 rdy/b s y
27 3390c?micro?7/05 AT89S2051/s4051 29. read user signature row function: 1. reads 1 to 32 bytes of data from the user signature row. 2. x-address (page) should be 00h from a previous load-x command. 3. y-address (offset) incremented by positive pulse on xtal1. usage: 1. execute the load-x command to set the page to 00h and reset the offset. 2. apply ?1000? testcode to p3.7, p3.5, p3.4, p3.3. 3. read 8-bit data on port p1. 4. for additional bytes (up to 32), pulse xtal1 high for at least 100 ns to increment the y- address and repeat step 3. the address will change on the falling edge of xtal1. figure 29-1. read user signature row sequence 00h dout0 dout1 dout n-1 1101 1000 p3.2 xtal1 p3.3 - p3.7 p1.0 - p1.7 rdy/b s y
28 3390c?micro?7/05 AT89S2051/s4051 30. read atmel signature row function: 1. reads 1 to 32 bytes of data from the atmel signature row. 2. x-address (page) should be 01h from a previous load-x command. 3. y-address (offset) incremented by positive pulse on xtal1. usage : 1. execute the load-x command to set the page to 01h and reset the offset. 2. apply ?1000? testcode to p3.7, p3.5, p3.4, p3.3. 3. read 8-bit data on port p1. 4. for additional bytes (up to 32), pulse xtal1 high for at least 100 ns to increment the y- address and repeat step 3. the address will change on the falling edge of xtal1. figure 30-1. read atmel signature row sequence 01h dout0 dout1 dout n-1 1101 1000 p3.2 xtal1 p3.3 - p3.7 p1.0 - p1.7 rdy/b s y
29 3390c?micro?7/05 AT89S2051/s4051 31. write lock bits/user fuses function: 1. program lock bits 1 and 2. 2. program user fuses. usage: 1) apply ?1111? testcode to p3.7, p3.5, p3.4, p3.3. 3. drive port p1 with fuse data, bits [7:4] for fuses and bits [1:0] for lock bits. 4. pulse p3.2 low for 1 s. 5. wait 4 ms, monitor p3.1, or poll data. figure 31-1. write lock bits/user fuses 32. read lock bits/user fuses function: 1. read status of lock bits 1 and 2. 2. read status of user fuses. usage: 1. apply ?0011? testcode to p3.7, p3.5, p3.4, p3.3. 2. read fuse data from port p1, bits [7:4] for fuses and bits [1:0] for lock bits. figure 32-1. read lock bits/user fuses data 1111 p3.2 xtal1 p3.3 - p3.7 p1.0 - p1.7 rdy/b s y high z high z dout 0011 p3.2 xtal1 p3.3. - p3.7 p1.0 - p1.7 rdy/b s y high z high z
30 3390c?micro?7/05 AT89S2051/s4051 figure 32-2. flash programming and verification waveforms in parallel mode loadx xaddr data0 data1 datan xaddr data0 data1 datan page write loadx page read t pwrdn t h s tl t pwrup t p s tp t h s tl t por t a s tp t ahld t xtw t m s tp t pgw t d s tp t phx t xlp t dhld t blt t phbl t wc t m s tp t mhld t vfy t rdt vcc r s t/vpp p 3 .2/prog p 3 . 3 ...p 3 .7 port0 xtal1 p 3 .1 (rdy/b s y)
31 3390c?micro?7/05 AT89S2051/s4051 table 32-1. parallel flash programming and verification parameters symbol parameter min max units v pp programming enable voltage 11.5 12.5 v i pp programming enable current 1.0 ma t pwrup power-on to rst high 10 s t por power-on reset time 2 ms t pstp prog setup to v pp high 10 s t hstl high voltage setting time 10 s t mstp mode setup to prog or xtal1 1 s t mhld mode hold after prog or xtal2 1 s t xtw xtal1 high width 0.5 s t astp address setup to xtal1 high 0.5 s t ahld address hold after xtal1 low 0.5 s t pgw prog low width 1 s t dstp data setup to prog low 0.5 s t dhld data hold after prog high 0.5 s t xlp xtal1 low to prog low 0.5 s t phx prog high to xtal1 high 0.5 s t blt byte load period 150 s t phbl prog high to busy low 256 s t wc wire cycle time 4.5 ms t rdt read byte time 1 s t vfy xtal1 low to data verify valid 0.25 s t pwrdn rst low to power off 1 s
32 3390c?micro?7/05 AT89S2051/s4051 33. in-system programming (isp) specification atmel?s AT89S2051/s4051 offers 2k/4k bytes of in-system programmable flash code memory. in addition, the device contains a 32-byte us er signature row and a 32-byte read-only atmel signature row. figure 33-1. isp programming device connections note: 1. sck frequency should be less than (xtal frequency)/8. table 33-1. memory organization device # page size # pages address range page range AT89S2051 32 bytes 64 0000h - 07ffh 00h - 3fh at89s4051 32 bytes 128 0000h - 0fffh 00h - 7fh sck (1) serial in (mosi) 2.7v to 5.5v p1.7 v cc rst p1.6 xtal1 gnd v cc AT89S2051/s4051 p1.5 serial out (miso)
33 3390c?micro?7/05 AT89S2051/s4051 notes: 1. program enable must be the first command issued after entering into the serial programming mode. 2. all 32 data bytes must be written/read. 3. fuse bit definitions: * the isp enable fuse must be enabled before entering isp mode. when disabling the isp fuse during isp mode, the current fuse state will remain active until rst is brought low. **any change will only take effect after the next power-down/power-up cycle event. 4. lock bit definitions: 5. atmel signature bytes : 34. serial programming command summary command byte 1 byte 2 byte 3 byte 4 byte ... program enable (1) 1010 1100 0101 0011 xxxx xxxx xxxx xxxx chip erase 1010 1100 100x xxxx xxxx xxxx xxxx xxxx write code byte 0100 0000 xxxx read code byte 0010 0000 xxxx write code page (2) 0101 0000 xxxx 0 0000 data 0 ... data 31 read code page (2) 0011 0000 xxxx 0 0000 data 0 ... data 31 write user fuses (3) 1010 1100 0001 xxxx xxxx xxxx xxxx read user fuses (3) 0010 0001 xxxx xxxx xxxx xxxx xxxx write lock bits (4) 1010 1100 1110 0x xxxx xxxx xxxx xxxx read lock bits (4) 0010 0100 xxxx xxxx xxxx xxxx xxxx xx write user signature byte 0100 0010 xxxx xxxx xxx read user signature byte 0010 0010 xxxx xxxx xxx write user signature page (2) 0101 0010 xxxx xxxx xxxx xxxx data 0 ... data 31 read user signature page (2) 0011 0010 xxxx xxxx xxxx xxxx data 0 ... data 31 read atmel signature byte (5) 0010 1000 xxxx xxxx xxx bit 0 bit 1 bit 2 bit 3 isp enable * x2 clock user row programming xtal osc bypass** enable = 0/disable = 1 enable = 0/disable = 1 enable = 0/disable = 1 enable = 0/disable = 1 bit 0 bit 1 lock bit 1 lock bit 2 locked = 0/unlocked = 1 locked = 0/unlocked = 1 AT89S2051: address 00h = 1eh 01h = 23h 02h = ffh at89s4051: address 00h = 1eh 01h = 43h 02h = ffh a11 a10 a9 a8 a11 a10 a9 a8 a11 a10 a9 a8 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 a7 a6 a5 a4 a3 a2 a1 a0 a7 a6 a5 a7 a6 a5 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 lb2 lb1 lb2 lb1 d7 d6 d5 d4 d3 d2 d1 d0 a4 a3 a2 a1 a0 a4 a3 a2 a1 a0 a4 a3 a2 a1 a0 f3 f2 f1 f0 f3 f2 f1 f0
34 3390c?micro?7/05 AT89S2051/s4051 35. power-up sequence execute this sequence to power-up the device before programming. 1. apply power between vcc and gnd pins. 2. keep sck (p1.7) at gnd. 3. wait 10 s and bring rst to ?h?. 4. if a crystal is connected between xtal1 and xtal2, wait at least 10 ms; otherwise, apply a 3 - 24 mhz clock to xtal1 and wait 4 ms. figure 35-1. isp power-up sequence 36. isp start sequence execute this sequence to enter isp when the device is already operational. 1. bring sck (p1.7) to gnd. 2. tri-state miso (p1.6). 3. bring rst to ?h?. figure 36-1. isp start sequence v cc r s t xtal1 p1.7/ s ck p1.6/mi s o p1.5/mo s i high z v cc r s t xtal1 p1.7/ s ck p1.6/mi s o p1.5/mo s i high z
35 3390c?micro?7/05 AT89S2051/s4051 37. power-down sequence execute this sequence to power-down the device after programming. 1. set xtal1 to ?l? if a crystal is not used. 2. bring rst to ?l?. 3. tri-state mosi (p1.5). figure 37-1. isp power-down sequence 38. isp byte sequence 1. data shifts in/out msb first. 2. miso changes at rising of sck. 3. mosi is sampled at falling edge of sck. figure 38-1. isp byte sequence 39. isp command sequence 1. byte format: 4 byte packet (3 header bytes + 1 data byte) 2. page format: 35 byte packet (3 header bytes + 32 data bytes) 3. all bytes are required, even if they are don?t care. figure 39-1. isp command sequence v cc r s t xtal1 p1.7/ s ck p1.6/mi s o p1.5/mo s i high z high z 76 5 4 3 2 10 76 5 4 3 2 10 p1.7/ s ck p1.6/mi s o p1.5/mo s i d a t a i s sa mpled s ck s o s i 7 ??? 0 7 ??? 0 7 ??? 0 7 dataout 0 7 opcode 0 0 0 7 addrh 7 addrl 7 datain 0
36 3390c?micro?7/05 AT89S2051/s4051 notes: 1. under steady state (non-transient) conditions, i ol must be externally limited as follows: maximum i ol per port pin: 10 ma maximum total i ol for all output pins: 25 ma (15 ma for at89s4051) if i ol exceeds the test condition, v ol may exceed the related specification. pins are not guaranteed to sink current greater than the listed test conditions. 2. minimum v cc for power-down is 2v. 3. p1.0 and p1.1 are comparator inputs and have no internal pullups. they should not be left floating. 40. absolute maximum ratings* operating temperature ................................. -55c to +125c *notice: stresses beyond those listed under ?absolute maximum ratings? may cause permanent dam- age to the device. this is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. storage temperature ..................................... -65c to +150c voltage on any pin with respect to ground......-0.7v to +6.2v maximum operating voltage ............................................ 5.5v dc output current............. 25.0 ma (15.0 ma for at89s4051) 41. dc characteristics t a = -40c to 85c, v cc = 2.7v to 5.5v (unless otherwise noted) symbol parameter condition min max units v il input low-voltage -0.5 0.2 v cc - 0.1 v v ih input high-voltage (except xtal1, rst) 0.2 v cc + 0.9 v cc + 0.5 v v ih1 input high-voltage (xtal1, rst) 0.7 v cc v cc + 0.5 v v ol output low-voltage (1) (ports 1, 3) i ol = 10 ma, v cc = 2.7v, t a = 85c 0.5 v v oh output high-voltage (ports 1, 3) i oh = -80 a, v cc = 5v 10% 2.4 v i oh = -30 a 0.75 v cc v i oh = -12 a 0.9 v cc v i il logical 0 input current (ports 1, 3) v in = 0.45v -50 a i tl logical 1 to 0 transition current (ports 1, 3) v in = 2v, v cc = 5v 10% -350 a i li input leakage current (port p1.0, p1.1) 0 < v in < v cc 10 a v os comparator input offset voltage v cc = 5v 20 mv v cm comparator input common mode voltage 0v cc v rrst reset pull-down resistor 50 150 k ? c io pin capacitance test freq. = 1 mhz, t a = 25c 10 pf i cc power supply current (without the ) active mode, 24/12 mhz, v cc = 5v/3v 10.5/3.5 ma idle mode, 24/12 mhz, v cc = 5v/3v p1.0 & p1.1 = 0v or v cc 4.5/2.5 ma power-down mode (2) v cc = 5v, p1.0 & p1.1 = 0v or v cc (3) 10 a v cc = 3v, p1.0 & p1.1 = 0v or v cc (3) 5a
37 3390c?micro?7/05 AT89S2051/s4051 42. external clock drive waveforms 43. external clock drive symbol parameter v cc = 2.7v to 5.5v units min max 1/t clcl frequency 0 24 mhz t clcl clock period 41.6 ns t chcx high time 12 ns t clcx low time 12 ns t clch rise time 5ns t chcl fall time 5ns
38 3390c?micro?7/05 AT89S2051/s4051 45. shift register mode timing waveforms 46. ac testing input/output waveforms (1) note: 1. ac inputs during testing are driven at v cc - 0.5v for a logic 1 and 0.45v for a logic 0. timing measurements are made at v ih min. for a logic 1 and v il max. for a logic 0. 47. float waveforms (1) note: 1. for timing purposes, a port pin is no longer floating when a 100 mv change from load voltage occurs. a port pin begins to float when 100 mv change from the loaded v oh /v ol level occurs. 44. serial port timing: shift register mode test conditions the values in this table are valid for v cc = 2.7v to 5.5v and load capacitance = 80 pf. symbol parameter variable units min max t xlxl serial port clock cycle time 12t clcl -15 s t qvxh output data setup to clock rising edge 10t clcl -15 ns t xhqx output data hold after clock rising edge 2t clcl -15 ns t xhdx input data hold after clock rising edge t clcl ns t xhdv input data valid to clock rising edge 0 ns
39 3390c?micro?7/05 AT89S2051/s4051 48. i cc test condition, active mode, all other pins are disconnected 49. i cc test condition, idle mode, all other pins are disconnected 50. clock signal waveform for i cc tests in active and idle modes, t clch = t chcl = 5 ns 51. i cc test condition, power-down mode, all other pins are disconnected, v cc = 2v to 5.5v xtal2 r s t v cc v cc i cc xtal1 v ss (nc) clock s ignal v cc p1, p 3 xtal2 r s t v cc v cc i cc xtal1 v ss (nc) clock s ignal v cc p1, p 3 v cc - 0.5v 0.45v 0.2 v cc - 0.1v 0.7 v cc t chcx t chcx t clch t chcl t clcl xtal2 r s t v cc v cc i cc xtal1 v ss (nc) v cc p1, p 3
40 3390c?micro?7/05 AT89S2051/s4051 52. i cc (active mode) measurements i cc act iv e @ 25 o c 1.50 2.00 2.50 3.00 3.50 4.00 123456789101112 frequency (mhz) i cc active (ma) 3.0v 4.0v 5.0v i cc activ e @ 90 o c 1.50 2.00 2.50 3.00 3.50 4.00 123456789101112 frequency (mhz) i cc active (ma) 3.0 v 4.0 v 5.0 v
41 3390c?micro?7/05 AT89S2051/s4051 53. i cc (idle mode) measurements 54. i cc (power down mode) measurements i cc idle vs. frequency t = 25c 0 0.5 1 1.5 2 2.5 3 0 5 10 15 20 25 frequency (mhz) i cc (ma) vcc=3v vcc=4v vcc=5v i cc in power-down 0 0.5 1 1.5 2 2.5 1234567 v cc (v) i cc pwd (ua) 0 deg c 25 deg c 90 deg c
42 3390c?micro?7/05 AT89S2051/s4051 55. ordering information 55.1 standard package speed (mhz) power supply ordering code package operation range 24 2.7v to 5.5v AT89S2051/s4051-24pc AT89S2051/s4051-24sc 20p3 20s2 commercial (0 c to 70 c) AT89S2051/s4051-24pi AT89S2051/s4051-24si 20p3 20s2 industrial (-40 c to 85 c) 55.2 green package option (pb/halide-free) speed (mhz) power supply ordering code package operation range 24 2.7v to 5.5v AT89S2051/s4051-24pu AT89S2051/s4051-24su 20p3 20s2 industrial (-40 c to 85 c) package type 20p3 20-lead, 0.300? wide, plastic dual in-line package (pdip) 20s2 20-lead, 0.300? wide, plastic gull wing small outline (soic)
43 3390c?micro?7/05 AT89S2051/s4051 56. package information 56.1 20p3 ? pdip 2325 orchard parkway san jose, ca 95131 title drawing no. r rev. 20p3 , 20-lead (0.300"/7.62 mm wide) plastic dual inline package (pdip) d 20p3 1/23/04 pin 1 e1 a1 b e b1 c l seating plane a d e eb ec common dimensions (unit of measure = mm) symbol min nom max note a ? ? 5.334 a1 0.381 ? ? d 24.892 ? 26.924 note 2 e 7.620 ? 8.255 e1 6.096 ? 7.112 note 2 b 0.356 ? 0.559 b1 1.270 ? 1.551 l 2.921 ? 3.810 c 0.203 ? 0.356 eb ? ? 10.922 ec 0.000 ? 1.524 e 2.540 typ notes: 1. this package conforms to jedec reference ms-001, variation ad. 2. dimensions d and e1 do not include mold flash or protrusion. mold flash or protrusion shall not exceed 0.25 mm (0.010").
44 3390c?micro?7/05 AT89S2051/s4051 56.2 20s2 ? soic 2325 orchard parkway san jose, ca 95131 title drawing no. r rev. 20s2 , 20-lead, 0.300" wide body, plastic gull wing small outline package (soic) 1/9/02 20s2 a l a1 end view side view top view h e b n 1 e a d c common dimensions (unit of measure = inches) symbol min nom max note notes: 1. this drawing is for general information only; refer to jedec drawing ms-013, variation ac for additional information. 2. dimension "d" does not include mold flash, protrusions or gate burrs. mold flash, protrusions and gate burrs shall not exc eed 0.15 mm (0.006") per side. 3. dimension "e" does not include inter-lead flash or protrusion. inter-lead flash and protrusions shall not exceed 0.25 mm (0.010") per side. 4. "l" is the length of the terminal for soldering to a substrate. 5. the lead width "b", as measured 0.36 mm (0.014") or greater above the seating plane, shall not exceed a maximum value of 0.61 mm (0.024") per side. a 0.0926 0.1043 a1 0.0040 0.0118 b 0.0130 0.0200 4 c 0.0091 0.0125 d 0.4961 0.5118 1 e 0.2914 0.2992 2 h 0.3940 0.4190 l 0.0160 0.050 3 e 0.050 bsc
printed on recycled paper. 3390c?micro?7/05 xm disclaimer: the information in this document is provided in connection wit h atmel products. no license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this docum ent or in connection with the sale of atmel products. except as set forth in atmel?s terms and condi- tions of sale located on atmel?s web site, atmel assumes no li ability whatsoever and disclaims any express, implied or statutor y warranty relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particu lar purpose, or non-infringement. in no event shall atmel be liable for any direct, indirect, conseque ntial, punitive, special or i nciden- tal damages (including, without limitation, damages for loss of profits, business interruption, or loss of information) arising out of the use or inability to use this document, even if atmel has been advised of the possibility of such damages. atmel makes no representations or warranties with respect to the accuracy or co mpleteness of the contents of this document and reserves the ri ght to make changes to specifications and product descriptions at any time without notice. atmel does not make any commitment to update the information contained her ein. unless specifically provided otherwise, atmel products are not suitable for, and shall not be used in, automotive applications. atmel?s products are not int ended, authorized, or warranted for use as components in applications intended to support or sustain life atmel corporation atmel operations 2325 orchard parkway san jose, ca 95131, usa tel: 1(408) 441-0311 fax: 1(408) 487-2600 regional headquarters europe atmel sarl route des arsenaux 41 case postale 80 ch-1705 fribourg switzerland tel: (41) 26-426-5555 fax: (41) 26-426-5500 asia room 1219 chinachem golden plaza 77 mody road tsimshatsui east kowloon hong kong tel: (852) 2721-9778 fax: (852) 2722-1369 japan 9f, tonetsu shinkawa bldg. 1-24-8 shinkawa chuo-ku, tokyo 104-0033 japan tel: (81) 3-3523-3551 fax: (81) 3-3523-7581 memory 2325 orchard parkway san jose, ca 95131, usa tel: 1(408) 441-0311 fax: 1(408) 436-4314 microcontrollers 2325 orchard parkway san jose, ca 95131, usa tel: 1(408) 441-0311 fax: 1(408) 436-4314 la chantrerie bp 70602 44306 nantes cedex 3, france tel: (33) 2-40-18-18-18 fax: (33) 2-40-18-19-60 asic/assp/smart cards zone industrielle 13106 rousset cedex, france tel: (33) 4-42-53-60-00 fax: (33) 4-42-53-60-01 1150 east cheyenne mtn. blvd. colorado springs, co 80906, usa tel: 1(719) 576-3300 fax: 1(719) 540-1759 scottish enterprise technology park maxwell building east kilbride g75 0qr, scotland tel: (44) 1355-803-000 fax: (44) 1355-242-743 rf/automotive theresienstrasse 2 postfach 3535 74025 heilbronn, germany tel: (49) 71-31-67-0 fax: (49) 71-31-67-2340 1150 east cheyenne mtn. blvd. colorado springs, co 80906, usa tel: 1(719) 576-3300 fax: 1(719) 540-1759 biometrics/imaging/hi-rel mpu/ high speed converters/rf datacom avenue de rochepleine bp 123 38521 saint-egreve cedex, france tel: (33) 4-76-58-30-00 fax: (33) 4-76-58-34-80 literature requests www.atmel.com/literature ? atmel corporation 2005 . all rights reserved. atmel ? , logo and combinations thereof, everywhere you are ? and others, are registered trademarks or trademarks of atmel corporation or it s subsidiaries. other terms and product names may be trademarks o f others.


▲Up To Search▲   

 
Price & Availability of AT89S2051

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X